# -*- coding:UTF-8 -*-

"""
用于二维码生成步骤
"""

import qrcode

class Qrobj():
    def __init__(self):
        self.qr = qrcode.QRCode(
            version=None,
            error_correction=qrcode.ERROR_CORRECT_L,
            box_size=10,
            border=4,
        )
    def update(self,num,msg):
        data = str(num)+"&"+str(msg)
        print data
        s = data.split("&")
        print s
        self.qr.add_data(data)

    def make(self):
        self.qr.make(fit=True)

    def get_img(self):
        img = self.qr.make_image()
        return img

if __name__ == '__main__':
    num = ['13888888888','13777777777']
    msg = ["您有一封特提文件等待收取"]
    qr = Qrobj()
    qr.update(num,msg)
    qr.make()
    qr.get_img().save("test.png")

